package com.hwadee.caixiang.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hwadee.caixiang.entity.User;
import com.hwadee.caixiang.dao.RegisterMapper;
import com.hwadee.caixiang.service.RegisterService;

@Service
public class RegisterServiceImpl implements RegisterService {

	@Autowired
	private RegisterMapper registerMapper;

	@Override
	public int addUser(User user) {

		return registerMapper.insert(user);
	}

	@Override
	public int findByUserName(String username) {
		User user = registerMapper.findByUserName(username);
		if( null != user ) {
			return 1;
		}
		return 0;
	}
	

}
